home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C# & Game Programming - A…er's Guide (2nd Edition)
/
Buono 2nd Ed.iso
/
Chapter5
/
5.53
/
5.53.cs
next >
Wrap
Text File
|
2004-09-07
|
572b
|
22 lines
/* Fixed pointers. */
using System;
namespace Chapter5 {
class ClassFixed {
public int variable;
}
class Class1 {
static unsafe void Main () {
ClassFixed TestFixed = new ClassFixed();
Console.Write("Enter a number: ");
TestFixed.variable = int.Parse(Console.ReadLine());
fixed (int* pointer = &TestFixed.variable) {
Console.WriteLine("\n{0}", TestFixed.variable);
Console.WriteLine("\n{0}", *pointer);
}
}
}
}